<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>
    <button onclick="btnclick()">11111111111</button>
</body>

<script>

    var b = true;
    function btnclick() {

        if (!b)
            return;



        console.log("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
        console.log(b);

        b = false;
        //for (var i = 0; i < 1000000; i++) {
        //    var str = new Date() + "";
        //}
        b = true;
        console.log("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    }


</script>

</html>